{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd\n",
    "import numpy as np"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 定义一个一维数组，和分区的范围，再cut（分割）一下"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [],
   "source": [
    "ages = pd.Series([12,25,36,45,55,67,88,99])\n",
    "bins = [10,20,30,40,50,60,70,80,90,100]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0     (10, 20]\n",
       "1     (20, 30]\n",
       "2     (30, 40]\n",
       "3     (40, 50]\n",
       "4     (50, 60]\n",
       "5     (60, 70]\n",
       "6     (80, 90]\n",
       "7    (90, 100]\n",
       "dtype: category\n",
       "Categories (9, interval[int64]): [(10, 20] < (20, 30] < (30, 40] < (40, 50] ... (60, 70] < (70, 80] < (80, 90] < (90, 100]]"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "cuts=pd.cut(ages,bins)\n",
    "cuts"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0    15\n",
       "1    19\n",
       "2    25\n",
       "3    22\n",
       "4    30\n",
       "5    45\n",
       "6    66\n",
       "7    70\n",
       "8    58\n",
       "dtype: int64"
      ]
     },
     "execution_count": 26,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "age = pd.Series([15,19,25,22,30,45,66,70,58])\n",
    "bins = [12,25,45,50,100]\n",
    "age"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 33,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0     (12, 25]\n",
       "1     (12, 25]\n",
       "2     (12, 25]\n",
       "3     (12, 25]\n",
       "4     (25, 45]\n",
       "5     (25, 45]\n",
       "6    (50, 100]\n",
       "7    (50, 100]\n",
       "8    (50, 100]\n",
       "dtype: category\n",
       "Categories (4, interval[int64]): [(12, 25] < (25, 45] < (45, 50] < (50, 100]]"
      ]
     },
     "execution_count": 33,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "cuts2=pd.cut(age,bins)\n",
    "cuts2"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 案例一：预处理部分地区数据"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 读取北京地区的数据\n",
    "#### 读取天津地区的数据\n",
    "#### 检测file_data_bjinfo中的数据，返回TRUE的表示是重复数据\n",
    "#### 检测file_data_tjinfo中的数据，返回TRUE的表示重复数据\n",
    "#### 对北京地区的数据，删除重复值\n",
    "#### 检测天津地区的数据是否存在缺失值\n",
    "#### 计算天津地区常住人口的平均数，设置float类型，并保留两位小数。并且以字典映射的方式进行填充\n",
    "#### 对北京地区信息进行异常值检测。并且用箱型图进行表示\n",
    "#### 对天津地区信息进行异常值检测。并且用箱型图进行表示\n",
    "#### 对两地数据进行合并"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 读取北京地区的数据¶"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 86,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>省级单位</th>\n",
       "      <th>地级单位</th>\n",
       "      <th>县级单位</th>\n",
       "      <th>区划类型</th>\n",
       "      <th>行政面积（K㎡）</th>\n",
       "      <th>户籍人口（万人）</th>\n",
       "      <th>男性</th>\n",
       "      <th>女性</th>\n",
       "      <th>GDP（亿元）</th>\n",
       "      <th>常住人口（万人）</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>北京</td>\n",
       "      <td>北京</td>\n",
       "      <td>西城区</td>\n",
       "      <td>市辖区</td>\n",
       "      <td>51</td>\n",
       "      <td>146.47</td>\n",
       "      <td>72.88</td>\n",
       "      <td>73.59</td>\n",
       "      <td>3602.36</td>\n",
       "      <td>125.9</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>北京</td>\n",
       "      <td>北京</td>\n",
       "      <td>东城区</td>\n",
       "      <td>市辖区</td>\n",
       "      <td>42</td>\n",
       "      <td>97.41</td>\n",
       "      <td>47.91</td>\n",
       "      <td>49.50</td>\n",
       "      <td>2061.80</td>\n",
       "      <td>87.8</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>北京</td>\n",
       "      <td>北京</td>\n",
       "      <td>丰台区</td>\n",
       "      <td>市辖区</td>\n",
       "      <td>306</td>\n",
       "      <td>115.33</td>\n",
       "      <td>58.39</td>\n",
       "      <td>56.95</td>\n",
       "      <td>1297.03</td>\n",
       "      <td>225.5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>北京</td>\n",
       "      <td>北京</td>\n",
       "      <td>西城区</td>\n",
       "      <td>市辖区</td>\n",
       "      <td>51</td>\n",
       "      <td>146.47</td>\n",
       "      <td>72.88</td>\n",
       "      <td>73.59</td>\n",
       "      <td>3602.36</td>\n",
       "      <td>125.9</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>北京</td>\n",
       "      <td>北京</td>\n",
       "      <td>朝阳区</td>\n",
       "      <td>市辖区</td>\n",
       "      <td>455</td>\n",
       "      <td>210.91</td>\n",
       "      <td>105.43</td>\n",
       "      <td>105.48</td>\n",
       "      <td>5171.03</td>\n",
       "      <td>385.6</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>北京</td>\n",
       "      <td>北京</td>\n",
       "      <td>房山区</td>\n",
       "      <td>市辖区</td>\n",
       "      <td>1990</td>\n",
       "      <td>81.28</td>\n",
       "      <td>40.76</td>\n",
       "      <td>40.52</td>\n",
       "      <td>606.61</td>\n",
       "      <td>109.6</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>北京</td>\n",
       "      <td>北京</td>\n",
       "      <td>丰台区</td>\n",
       "      <td>市辖区</td>\n",
       "      <td>306</td>\n",
       "      <td>115.33</td>\n",
       "      <td>58.39</td>\n",
       "      <td>56.95</td>\n",
       "      <td>1297.03</td>\n",
       "      <td>225.5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>北京</td>\n",
       "      <td>北京</td>\n",
       "      <td>石景山区</td>\n",
       "      <td>市辖区</td>\n",
       "      <td>84</td>\n",
       "      <td>38.69</td>\n",
       "      <td>19.87</td>\n",
       "      <td>18.82</td>\n",
       "      <td>482.14</td>\n",
       "      <td>63.4</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>北京</td>\n",
       "      <td>北京</td>\n",
       "      <td>海淀区</td>\n",
       "      <td>市辖区</td>\n",
       "      <td>431</td>\n",
       "      <td>240.20</td>\n",
       "      <td>120.08</td>\n",
       "      <td>120.12</td>\n",
       "      <td>5395.16</td>\n",
       "      <td>359.3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>北京</td>\n",
       "      <td>北京</td>\n",
       "      <td>房山区</td>\n",
       "      <td>市辖区</td>\n",
       "      <td>1990</td>\n",
       "      <td>81.28</td>\n",
       "      <td>40.76</td>\n",
       "      <td>40.52</td>\n",
       "      <td>606.61</td>\n",
       "      <td>109.6</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>北京</td>\n",
       "      <td>北京</td>\n",
       "      <td>通州区</td>\n",
       "      <td>市辖区</td>\n",
       "      <td>906</td>\n",
       "      <td>74.68</td>\n",
       "      <td>37.08</td>\n",
       "      <td>37.60</td>\n",
       "      <td>674.81</td>\n",
       "      <td>142.8</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>北京</td>\n",
       "      <td>北京</td>\n",
       "      <td>顺义区</td>\n",
       "      <td>市辖区</td>\n",
       "      <td>1020</td>\n",
       "      <td>62.74</td>\n",
       "      <td>31.12</td>\n",
       "      <td>31.61</td>\n",
       "      <td>1591.60</td>\n",
       "      <td>107.5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>北京</td>\n",
       "      <td>北京</td>\n",
       "      <td>昌平区</td>\n",
       "      <td>市辖区</td>\n",
       "      <td>1344</td>\n",
       "      <td>61.14</td>\n",
       "      <td>30.72</td>\n",
       "      <td>30.41</td>\n",
       "      <td>753.39</td>\n",
       "      <td>201.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>北京</td>\n",
       "      <td>北京</td>\n",
       "      <td>大兴区</td>\n",
       "      <td>市辖区</td>\n",
       "      <td>1036</td>\n",
       "      <td>68.38</td>\n",
       "      <td>34.02</td>\n",
       "      <td>34.36</td>\n",
       "      <td>1796.95</td>\n",
       "      <td>169.4</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>北京</td>\n",
       "      <td>北京</td>\n",
       "      <td>门头沟区</td>\n",
       "      <td>市辖区</td>\n",
       "      <td>1451</td>\n",
       "      <td>25.12</td>\n",
       "      <td>12.80</td>\n",
       "      <td>12.32</td>\n",
       "      <td>157.86</td>\n",
       "      <td>31.1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>北京</td>\n",
       "      <td>北京</td>\n",
       "      <td>怀柔区</td>\n",
       "      <td>市辖区</td>\n",
       "      <td>2123</td>\n",
       "      <td>28.29</td>\n",
       "      <td>14.13</td>\n",
       "      <td>14.16</td>\n",
       "      <td>259.41</td>\n",
       "      <td>39.3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>北京</td>\n",
       "      <td>北京</td>\n",
       "      <td>平谷区</td>\n",
       "      <td>市辖区</td>\n",
       "      <td>950</td>\n",
       "      <td>40.20</td>\n",
       "      <td>20.22</td>\n",
       "      <td>19.98</td>\n",
       "      <td>218.31</td>\n",
       "      <td>43.7</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>北京</td>\n",
       "      <td>北京</td>\n",
       "      <td>密云区</td>\n",
       "      <td>市辖区</td>\n",
       "      <td>2229</td>\n",
       "      <td>43.59</td>\n",
       "      <td>21.77</td>\n",
       "      <td>21.82</td>\n",
       "      <td>251.13</td>\n",
       "      <td>48.3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>北京</td>\n",
       "      <td>北京</td>\n",
       "      <td>延庆区</td>\n",
       "      <td>市辖区</td>\n",
       "      <td>1994</td>\n",
       "      <td>28.42</td>\n",
       "      <td>14.32</td>\n",
       "      <td>14.11</td>\n",
       "      <td>122.66</td>\n",
       "      <td>32.7</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   省级单位 地级单位  县级单位 区划类型  行政面积（K㎡）  户籍人口（万人）      男性      女性  GDP（亿元）  常住人口（万人）\n",
       "0    北京   北京   西城区  市辖区        51    146.47   72.88   73.59  3602.36     125.9\n",
       "1    北京   北京   东城区  市辖区        42     97.41   47.91   49.50  2061.80      87.8\n",
       "2    北京   北京   丰台区  市辖区       306    115.33   58.39   56.95  1297.03     225.5\n",
       "3    北京   北京   西城区  市辖区        51    146.47   72.88   73.59  3602.36     125.9\n",
       "4    北京   北京   朝阳区  市辖区       455    210.91  105.43  105.48  5171.03     385.6\n",
       "5    北京   北京   房山区  市辖区      1990     81.28   40.76   40.52   606.61     109.6\n",
       "6    北京   北京   丰台区  市辖区       306    115.33   58.39   56.95  1297.03     225.5\n",
       "7    北京   北京  石景山区  市辖区        84     38.69   19.87   18.82   482.14      63.4\n",
       "8    北京   北京   海淀区  市辖区       431    240.20  120.08  120.12  5395.16     359.3\n",
       "9    北京   北京   房山区  市辖区      1990     81.28   40.76   40.52   606.61     109.6\n",
       "10   北京   北京   通州区  市辖区       906     74.68   37.08   37.60   674.81     142.8\n",
       "11   北京   北京   顺义区  市辖区      1020     62.74   31.12   31.61  1591.60     107.5\n",
       "12   北京   北京   昌平区  市辖区      1344     61.14   30.72   30.41   753.39     201.0\n",
       "13   北京   北京   大兴区  市辖区      1036     68.38   34.02   34.36  1796.95     169.4\n",
       "14   北京   北京  门头沟区  市辖区      1451     25.12   12.80   12.32   157.86      31.1\n",
       "15   北京   北京   怀柔区  市辖区      2123     28.29   14.13   14.16   259.41      39.3\n",
       "16   北京   北京   平谷区  市辖区       950     40.20   20.22   19.98   218.31      43.7\n",
       "17   北京   北京   密云区  市辖区      2229     43.59   21.77   21.82   251.13      48.3\n",
       "18   北京   北京   延庆区  市辖区      1994     28.42   14.32   14.11   122.66      32.7"
      ]
     },
     "execution_count": 86,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "bj_37=pd.read_csv('北京地区信息.csv',encoding=\"gbk\")\n",
    "bj_37"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 读取天津地区的数据"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 106,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>省级单位</th>\n",
       "      <th>地级单位</th>\n",
       "      <th>县级单位</th>\n",
       "      <th>区划类型</th>\n",
       "      <th>行政面积（K㎡）</th>\n",
       "      <th>户籍人口（万人）</th>\n",
       "      <th>男性</th>\n",
       "      <th>女性</th>\n",
       "      <th>GDP（亿元）</th>\n",
       "      <th>常住人口（万人）</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>天津</td>\n",
       "      <td>天津</td>\n",
       "      <td>和平区</td>\n",
       "      <td>市辖区</td>\n",
       "      <td>10</td>\n",
       "      <td>42.32</td>\n",
       "      <td>20.37</td>\n",
       "      <td>21.95</td>\n",
       "      <td>802.62</td>\n",
       "      <td>35.19</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>天津</td>\n",
       "      <td>天津</td>\n",
       "      <td>河东区</td>\n",
       "      <td>市辖区</td>\n",
       "      <td>39</td>\n",
       "      <td>75.79</td>\n",
       "      <td>38.06</td>\n",
       "      <td>37.73</td>\n",
       "      <td>290.98</td>\n",
       "      <td>97.61</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>天津</td>\n",
       "      <td>天津</td>\n",
       "      <td>河西区</td>\n",
       "      <td>市辖区</td>\n",
       "      <td>37</td>\n",
       "      <td>83.20</td>\n",
       "      <td>40.83</td>\n",
       "      <td>42.37</td>\n",
       "      <td>819.85</td>\n",
       "      <td>99.25</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>天津</td>\n",
       "      <td>天津</td>\n",
       "      <td>南开区</td>\n",
       "      <td>市辖区</td>\n",
       "      <td>39</td>\n",
       "      <td>87.28</td>\n",
       "      <td>43.30</td>\n",
       "      <td>43.98</td>\n",
       "      <td>652.09</td>\n",
       "      <td>114.55</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>天津</td>\n",
       "      <td>天津</td>\n",
       "      <td>河北区</td>\n",
       "      <td>市辖区</td>\n",
       "      <td>27</td>\n",
       "      <td>63.42</td>\n",
       "      <td>31.86</td>\n",
       "      <td>31.56</td>\n",
       "      <td>415.67</td>\n",
       "      <td>89.24</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>天津</td>\n",
       "      <td>天津</td>\n",
       "      <td>红桥区</td>\n",
       "      <td>市辖区</td>\n",
       "      <td>21</td>\n",
       "      <td>51.66</td>\n",
       "      <td>25.93</td>\n",
       "      <td>25.73</td>\n",
       "      <td>208.16</td>\n",
       "      <td>56.69</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>天津</td>\n",
       "      <td>天津</td>\n",
       "      <td>东丽区</td>\n",
       "      <td>市辖区</td>\n",
       "      <td>460</td>\n",
       "      <td>37.70</td>\n",
       "      <td>18.83</td>\n",
       "      <td>18.87</td>\n",
       "      <td>927.08</td>\n",
       "      <td>76.04</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>天津</td>\n",
       "      <td>天津</td>\n",
       "      <td>西青区</td>\n",
       "      <td>市辖区</td>\n",
       "      <td>545</td>\n",
       "      <td>14.85</td>\n",
       "      <td>19.85</td>\n",
       "      <td>20.38</td>\n",
       "      <td>1040.27</td>\n",
       "      <td>85.37</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>天津</td>\n",
       "      <td>天津</td>\n",
       "      <td>津南区</td>\n",
       "      <td>市辖区</td>\n",
       "      <td>401</td>\n",
       "      <td>44.83</td>\n",
       "      <td>22.35</td>\n",
       "      <td>22.48</td>\n",
       "      <td>810.16</td>\n",
       "      <td>89.41</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>天津</td>\n",
       "      <td>天津</td>\n",
       "      <td>北辰区</td>\n",
       "      <td>市辖区</td>\n",
       "      <td>478</td>\n",
       "      <td>40.39</td>\n",
       "      <td>20.09</td>\n",
       "      <td>20.30</td>\n",
       "      <td>1058.14</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>天津</td>\n",
       "      <td>天津</td>\n",
       "      <td>武清区</td>\n",
       "      <td>市辖区</td>\n",
       "      <td>1570</td>\n",
       "      <td>92.27</td>\n",
       "      <td>45.86</td>\n",
       "      <td>46.41</td>\n",
       "      <td>1151.65</td>\n",
       "      <td>119.96</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>天津</td>\n",
       "      <td>天津</td>\n",
       "      <td>宝坻区</td>\n",
       "      <td>市辖区</td>\n",
       "      <td>1523</td>\n",
       "      <td>71.10</td>\n",
       "      <td>35.72</td>\n",
       "      <td>35.39</td>\n",
       "      <td>684.07</td>\n",
       "      <td>92.98</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>天津</td>\n",
       "      <td>天津</td>\n",
       "      <td>滨海新区</td>\n",
       "      <td>市辖区</td>\n",
       "      <td>2270</td>\n",
       "      <td>128.18</td>\n",
       "      <td>66.04</td>\n",
       "      <td>62.14</td>\n",
       "      <td>6654.00</td>\n",
       "      <td>299.42</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>天津</td>\n",
       "      <td>天津</td>\n",
       "      <td>宁河区</td>\n",
       "      <td>市辖区</td>\n",
       "      <td>1414</td>\n",
       "      <td>40.00</td>\n",
       "      <td>20.21</td>\n",
       "      <td>19.79</td>\n",
       "      <td>525.37</td>\n",
       "      <td>49.57</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>天津</td>\n",
       "      <td>天津</td>\n",
       "      <td>静海区</td>\n",
       "      <td>市辖区</td>\n",
       "      <td>1476</td>\n",
       "      <td>59.79</td>\n",
       "      <td>30.35</td>\n",
       "      <td>29.44</td>\n",
       "      <td>667.83</td>\n",
       "      <td>79.29</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>天津</td>\n",
       "      <td>天津</td>\n",
       "      <td>蓟州区</td>\n",
       "      <td>市辖区</td>\n",
       "      <td>1593</td>\n",
       "      <td>86.24</td>\n",
       "      <td>43.86</td>\n",
       "      <td>42.38</td>\n",
       "      <td>392.55</td>\n",
       "      <td>91.15</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   省级单位 地级单位  县级单位 区划类型  行政面积（K㎡）  户籍人口（万人）     男性     女性  GDP（亿元）  常住人口（万人）\n",
       "0    天津   天津   和平区  市辖区        10     42.32  20.37  21.95   802.62     35.19\n",
       "1    天津   天津   河东区  市辖区        39     75.79  38.06  37.73   290.98     97.61\n",
       "2    天津   天津   河西区  市辖区        37     83.20  40.83  42.37   819.85     99.25\n",
       "3    天津   天津   南开区  市辖区        39     87.28  43.30  43.98   652.09    114.55\n",
       "4    天津   天津   河北区  市辖区        27     63.42  31.86  31.56   415.67     89.24\n",
       "5    天津   天津   红桥区  市辖区        21     51.66  25.93  25.73   208.16     56.69\n",
       "6    天津   天津   东丽区  市辖区       460     37.70  18.83  18.87   927.08     76.04\n",
       "7    天津   天津   西青区  市辖区       545     14.85  19.85  20.38  1040.27     85.37\n",
       "8    天津   天津   津南区  市辖区       401     44.83  22.35  22.48   810.16     89.41\n",
       "9    天津   天津   北辰区  市辖区       478     40.39  20.09  20.30  1058.14       NaN\n",
       "10   天津   天津   武清区  市辖区      1570     92.27  45.86  46.41  1151.65    119.96\n",
       "11   天津   天津   宝坻区  市辖区      1523     71.10  35.72  35.39   684.07     92.98\n",
       "12   天津   天津  滨海新区  市辖区      2270    128.18  66.04  62.14  6654.00    299.42\n",
       "13   天津   天津   宁河区  市辖区      1414     40.00  20.21  19.79   525.37     49.57\n",
       "14   天津   天津   静海区  市辖区      1476     59.79  30.35  29.44   667.83     79.29\n",
       "15   天津   天津   蓟州区  市辖区      1593     86.24  43.86  42.38   392.55     91.15"
      ]
     },
     "execution_count": 106,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "tj_37 =pd.read_csv('天津地区信息.csv',encoding=\"gbk\")\n",
    "tj_37"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 检测file_data_bjinfo中的数据，返回TRUE的表示是重复数据"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 88,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0     False\n",
       "1     False\n",
       "2     False\n",
       "3      True\n",
       "4     False\n",
       "5     False\n",
       "6      True\n",
       "7     False\n",
       "8     False\n",
       "9      True\n",
       "10    False\n",
       "11    False\n",
       "12    False\n",
       "13    False\n",
       "14    False\n",
       "15    False\n",
       "16    False\n",
       "17    False\n",
       "18    False\n",
       "dtype: bool"
      ]
     },
     "execution_count": 88,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "bj_37.duplicated()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 检测file_data_tjinfo中的数据，返回TRUE的表示是重复数据"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 107,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0     False\n",
       "1     False\n",
       "2     False\n",
       "3     False\n",
       "4     False\n",
       "5     False\n",
       "6     False\n",
       "7     False\n",
       "8     False\n",
       "9     False\n",
       "10    False\n",
       "11    False\n",
       "12    False\n",
       "13    False\n",
       "14    False\n",
       "15    False\n",
       "dtype: bool"
      ]
     },
     "execution_count": 107,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "tj_37.duplicated()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 对北京地区的数据，删除重复值"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 90,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>省级单位</th>\n",
       "      <th>地级单位</th>\n",
       "      <th>县级单位</th>\n",
       "      <th>区划类型</th>\n",
       "      <th>行政面积（K㎡）</th>\n",
       "      <th>户籍人口（万人）</th>\n",
       "      <th>男性</th>\n",
       "      <th>女性</th>\n",
       "      <th>GDP（亿元）</th>\n",
       "      <th>常住人口（万人）</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>北京</td>\n",
       "      <td>北京</td>\n",
       "      <td>西城区</td>\n",
       "      <td>市辖区</td>\n",
       "      <td>51</td>\n",
       "      <td>146.47</td>\n",
       "      <td>72.88</td>\n",
       "      <td>73.59</td>\n",
       "      <td>3602.36</td>\n",
       "      <td>125.9</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>北京</td>\n",
       "      <td>北京</td>\n",
       "      <td>东城区</td>\n",
       "      <td>市辖区</td>\n",
       "      <td>42</td>\n",
       "      <td>97.41</td>\n",
       "      <td>47.91</td>\n",
       "      <td>49.50</td>\n",
       "      <td>2061.80</td>\n",
       "      <td>87.8</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>北京</td>\n",
       "      <td>北京</td>\n",
       "      <td>丰台区</td>\n",
       "      <td>市辖区</td>\n",
       "      <td>306</td>\n",
       "      <td>115.33</td>\n",
       "      <td>58.39</td>\n",
       "      <td>56.95</td>\n",
       "      <td>1297.03</td>\n",
       "      <td>225.5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>北京</td>\n",
       "      <td>北京</td>\n",
       "      <td>朝阳区</td>\n",
       "      <td>市辖区</td>\n",
       "      <td>455</td>\n",
       "      <td>210.91</td>\n",
       "      <td>105.43</td>\n",
       "      <td>105.48</td>\n",
       "      <td>5171.03</td>\n",
       "      <td>385.6</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>北京</td>\n",
       "      <td>北京</td>\n",
       "      <td>房山区</td>\n",
       "      <td>市辖区</td>\n",
       "      <td>1990</td>\n",
       "      <td>81.28</td>\n",
       "      <td>40.76</td>\n",
       "      <td>40.52</td>\n",
       "      <td>606.61</td>\n",
       "      <td>109.6</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>北京</td>\n",
       "      <td>北京</td>\n",
       "      <td>石景山区</td>\n",
       "      <td>市辖区</td>\n",
       "      <td>84</td>\n",
       "      <td>38.69</td>\n",
       "      <td>19.87</td>\n",
       "      <td>18.82</td>\n",
       "      <td>482.14</td>\n",
       "      <td>63.4</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>北京</td>\n",
       "      <td>北京</td>\n",
       "      <td>海淀区</td>\n",
       "      <td>市辖区</td>\n",
       "      <td>431</td>\n",
       "      <td>240.20</td>\n",
       "      <td>120.08</td>\n",
       "      <td>120.12</td>\n",
       "      <td>5395.16</td>\n",
       "      <td>359.3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>北京</td>\n",
       "      <td>北京</td>\n",
       "      <td>通州区</td>\n",
       "      <td>市辖区</td>\n",
       "      <td>906</td>\n",
       "      <td>74.68</td>\n",
       "      <td>37.08</td>\n",
       "      <td>37.60</td>\n",
       "      <td>674.81</td>\n",
       "      <td>142.8</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>北京</td>\n",
       "      <td>北京</td>\n",
       "      <td>顺义区</td>\n",
       "      <td>市辖区</td>\n",
       "      <td>1020</td>\n",
       "      <td>62.74</td>\n",
       "      <td>31.12</td>\n",
       "      <td>31.61</td>\n",
       "      <td>1591.60</td>\n",
       "      <td>107.5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>北京</td>\n",
       "      <td>北京</td>\n",
       "      <td>昌平区</td>\n",
       "      <td>市辖区</td>\n",
       "      <td>1344</td>\n",
       "      <td>61.14</td>\n",
       "      <td>30.72</td>\n",
       "      <td>30.41</td>\n",
       "      <td>753.39</td>\n",
       "      <td>201.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>北京</td>\n",
       "      <td>北京</td>\n",
       "      <td>大兴区</td>\n",
       "      <td>市辖区</td>\n",
       "      <td>1036</td>\n",
       "      <td>68.38</td>\n",
       "      <td>34.02</td>\n",
       "      <td>34.36</td>\n",
       "      <td>1796.95</td>\n",
       "      <td>169.4</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>北京</td>\n",
       "      <td>北京</td>\n",
       "      <td>门头沟区</td>\n",
       "      <td>市辖区</td>\n",
       "      <td>1451</td>\n",
       "      <td>25.12</td>\n",
       "      <td>12.80</td>\n",
       "      <td>12.32</td>\n",
       "      <td>157.86</td>\n",
       "      <td>31.1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>北京</td>\n",
       "      <td>北京</td>\n",
       "      <td>怀柔区</td>\n",
       "      <td>市辖区</td>\n",
       "      <td>2123</td>\n",
       "      <td>28.29</td>\n",
       "      <td>14.13</td>\n",
       "      <td>14.16</td>\n",
       "      <td>259.41</td>\n",
       "      <td>39.3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>北京</td>\n",
       "      <td>北京</td>\n",
       "      <td>平谷区</td>\n",
       "      <td>市辖区</td>\n",
       "      <td>950</td>\n",
       "      <td>40.20</td>\n",
       "      <td>20.22</td>\n",
       "      <td>19.98</td>\n",
       "      <td>218.31</td>\n",
       "      <td>43.7</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>北京</td>\n",
       "      <td>北京</td>\n",
       "      <td>密云区</td>\n",
       "      <td>市辖区</td>\n",
       "      <td>2229</td>\n",
       "      <td>43.59</td>\n",
       "      <td>21.77</td>\n",
       "      <td>21.82</td>\n",
       "      <td>251.13</td>\n",
       "      <td>48.3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>北京</td>\n",
       "      <td>北京</td>\n",
       "      <td>延庆区</td>\n",
       "      <td>市辖区</td>\n",
       "      <td>1994</td>\n",
       "      <td>28.42</td>\n",
       "      <td>14.32</td>\n",
       "      <td>14.11</td>\n",
       "      <td>122.66</td>\n",
       "      <td>32.7</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   省级单位 地级单位  县级单位 区划类型  行政面积（K㎡）  户籍人口（万人）      男性      女性  GDP（亿元）  常住人口（万人）\n",
       "0    北京   北京   西城区  市辖区        51    146.47   72.88   73.59  3602.36     125.9\n",
       "1    北京   北京   东城区  市辖区        42     97.41   47.91   49.50  2061.80      87.8\n",
       "2    北京   北京   丰台区  市辖区       306    115.33   58.39   56.95  1297.03     225.5\n",
       "4    北京   北京   朝阳区  市辖区       455    210.91  105.43  105.48  5171.03     385.6\n",
       "5    北京   北京   房山区  市辖区      1990     81.28   40.76   40.52   606.61     109.6\n",
       "7    北京   北京  石景山区  市辖区        84     38.69   19.87   18.82   482.14      63.4\n",
       "8    北京   北京   海淀区  市辖区       431    240.20  120.08  120.12  5395.16     359.3\n",
       "10   北京   北京   通州区  市辖区       906     74.68   37.08   37.60   674.81     142.8\n",
       "11   北京   北京   顺义区  市辖区      1020     62.74   31.12   31.61  1591.60     107.5\n",
       "12   北京   北京   昌平区  市辖区      1344     61.14   30.72   30.41   753.39     201.0\n",
       "13   北京   北京   大兴区  市辖区      1036     68.38   34.02   34.36  1796.95     169.4\n",
       "14   北京   北京  门头沟区  市辖区      1451     25.12   12.80   12.32   157.86      31.1\n",
       "15   北京   北京   怀柔区  市辖区      2123     28.29   14.13   14.16   259.41      39.3\n",
       "16   北京   北京   平谷区  市辖区       950     40.20   20.22   19.98   218.31      43.7\n",
       "17   北京   北京   密云区  市辖区      2229     43.59   21.77   21.82   251.13      48.3\n",
       "18   北京   北京   延庆区  市辖区      1994     28.42   14.32   14.11   122.66      32.7"
      ]
     },
     "execution_count": 90,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "bj_37.drop_duplicates()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 检测天津地区的数据是否存在缺失值"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 108,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>省级单位</th>\n",
       "      <th>地级单位</th>\n",
       "      <th>县级单位</th>\n",
       "      <th>区划类型</th>\n",
       "      <th>行政面积（K㎡）</th>\n",
       "      <th>户籍人口（万人）</th>\n",
       "      <th>男性</th>\n",
       "      <th>女性</th>\n",
       "      <th>GDP（亿元）</th>\n",
       "      <th>常住人口（万人）</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "     省级单位   地级单位   县级单位   区划类型  行政面积（K㎡）  户籍人口（万人）     男性     女性  GDP（亿元）  \\\n",
       "0   False  False  False  False     False     False  False  False    False   \n",
       "1   False  False  False  False     False     False  False  False    False   \n",
       "2   False  False  False  False     False     False  False  False    False   \n",
       "3   False  False  False  False     False     False  False  False    False   \n",
       "4   False  False  False  False     False     False  False  False    False   \n",
       "5   False  False  False  False     False     False  False  False    False   \n",
       "6   False  False  False  False     False     False  False  False    False   \n",
       "7   False  False  False  False     False     False  False  False    False   \n",
       "8   False  False  False  False     False     False  False  False    False   \n",
       "9   False  False  False  False     False     False  False  False    False   \n",
       "10  False  False  False  False     False     False  False  False    False   \n",
       "11  False  False  False  False     False     False  False  False    False   \n",
       "12  False  False  False  False     False     False  False  False    False   \n",
       "13  False  False  False  False     False     False  False  False    False   \n",
       "14  False  False  False  False     False     False  False  False    False   \n",
       "15  False  False  False  False     False     False  False  False    False   \n",
       "\n",
       "    常住人口（万人）  \n",
       "0      False  \n",
       "1      False  \n",
       "2      False  \n",
       "3      False  \n",
       "4      False  \n",
       "5      False  \n",
       "6      False  \n",
       "7      False  \n",
       "8      False  \n",
       "9       True  \n",
       "10     False  \n",
       "11     False  \n",
       "12     False  \n",
       "13     False  \n",
       "14     False  \n",
       "15     False  "
      ]
     },
     "execution_count": 108,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "tj_37.isnull()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 计算天津地区常住人口的平均数，设置float类型，并保留两位小数。并且以字典映射的方式进行填充"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 92,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0      35.19\n",
       "1      97.61\n",
       "2      99.25\n",
       "3     114.55\n",
       "4      89.24\n",
       "5      56.69\n",
       "6      76.04\n",
       "7      85.37\n",
       "8      89.41\n",
       "9        NaN\n",
       "10    119.96\n",
       "11     92.98\n",
       "12    299.42\n",
       "13     49.57\n",
       "14     79.29\n",
       "15     91.15\n",
       "Name: 常住人口（万人）, dtype: float64"
      ]
     },
     "execution_count": 92,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "tj_37[\"常住人口（万人）\"]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 109,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>省级单位</th>\n",
       "      <th>地级单位</th>\n",
       "      <th>县级单位</th>\n",
       "      <th>区划类型</th>\n",
       "      <th>行政面积（K㎡）</th>\n",
       "      <th>户籍人口（万人）</th>\n",
       "      <th>男性</th>\n",
       "      <th>女性</th>\n",
       "      <th>GDP（亿元）</th>\n",
       "      <th>常住人口（万人）</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>天津</td>\n",
       "      <td>天津</td>\n",
       "      <td>和平区</td>\n",
       "      <td>市辖区</td>\n",
       "      <td>10</td>\n",
       "      <td>42.32</td>\n",
       "      <td>20.37</td>\n",
       "      <td>21.95</td>\n",
       "      <td>802.62</td>\n",
       "      <td>35.19</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>天津</td>\n",
       "      <td>天津</td>\n",
       "      <td>河东区</td>\n",
       "      <td>市辖区</td>\n",
       "      <td>39</td>\n",
       "      <td>75.79</td>\n",
       "      <td>38.06</td>\n",
       "      <td>37.73</td>\n",
       "      <td>290.98</td>\n",
       "      <td>97.61</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>天津</td>\n",
       "      <td>天津</td>\n",
       "      <td>河西区</td>\n",
       "      <td>市辖区</td>\n",
       "      <td>37</td>\n",
       "      <td>83.20</td>\n",
       "      <td>40.83</td>\n",
       "      <td>42.37</td>\n",
       "      <td>819.85</td>\n",
       "      <td>99.25</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>天津</td>\n",
       "      <td>天津</td>\n",
       "      <td>南开区</td>\n",
       "      <td>市辖区</td>\n",
       "      <td>39</td>\n",
       "      <td>87.28</td>\n",
       "      <td>43.30</td>\n",
       "      <td>43.98</td>\n",
       "      <td>652.09</td>\n",
       "      <td>114.55</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>天津</td>\n",
       "      <td>天津</td>\n",
       "      <td>河北区</td>\n",
       "      <td>市辖区</td>\n",
       "      <td>27</td>\n",
       "      <td>63.42</td>\n",
       "      <td>31.86</td>\n",
       "      <td>31.56</td>\n",
       "      <td>415.67</td>\n",
       "      <td>89.24</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>天津</td>\n",
       "      <td>天津</td>\n",
       "      <td>红桥区</td>\n",
       "      <td>市辖区</td>\n",
       "      <td>21</td>\n",
       "      <td>51.66</td>\n",
       "      <td>25.93</td>\n",
       "      <td>25.73</td>\n",
       "      <td>208.16</td>\n",
       "      <td>56.69</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>天津</td>\n",
       "      <td>天津</td>\n",
       "      <td>东丽区</td>\n",
       "      <td>市辖区</td>\n",
       "      <td>460</td>\n",
       "      <td>37.70</td>\n",
       "      <td>18.83</td>\n",
       "      <td>18.87</td>\n",
       "      <td>927.08</td>\n",
       "      <td>76.04</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>天津</td>\n",
       "      <td>天津</td>\n",
       "      <td>西青区</td>\n",
       "      <td>市辖区</td>\n",
       "      <td>545</td>\n",
       "      <td>14.85</td>\n",
       "      <td>19.85</td>\n",
       "      <td>20.38</td>\n",
       "      <td>1040.27</td>\n",
       "      <td>85.37</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>天津</td>\n",
       "      <td>天津</td>\n",
       "      <td>津南区</td>\n",
       "      <td>市辖区</td>\n",
       "      <td>401</td>\n",
       "      <td>44.83</td>\n",
       "      <td>22.35</td>\n",
       "      <td>22.48</td>\n",
       "      <td>810.16</td>\n",
       "      <td>89.41</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>天津</td>\n",
       "      <td>天津</td>\n",
       "      <td>北辰区</td>\n",
       "      <td>市辖区</td>\n",
       "      <td>478</td>\n",
       "      <td>40.39</td>\n",
       "      <td>20.09</td>\n",
       "      <td>20.30</td>\n",
       "      <td>1058.14</td>\n",
       "      <td>98.38</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>天津</td>\n",
       "      <td>天津</td>\n",
       "      <td>武清区</td>\n",
       "      <td>市辖区</td>\n",
       "      <td>1570</td>\n",
       "      <td>92.27</td>\n",
       "      <td>45.86</td>\n",
       "      <td>46.41</td>\n",
       "      <td>1151.65</td>\n",
       "      <td>119.96</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>天津</td>\n",
       "      <td>天津</td>\n",
       "      <td>宝坻区</td>\n",
       "      <td>市辖区</td>\n",
       "      <td>1523</td>\n",
       "      <td>71.10</td>\n",
       "      <td>35.72</td>\n",
       "      <td>35.39</td>\n",
       "      <td>684.07</td>\n",
       "      <td>92.98</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>天津</td>\n",
       "      <td>天津</td>\n",
       "      <td>滨海新区</td>\n",
       "      <td>市辖区</td>\n",
       "      <td>2270</td>\n",
       "      <td>128.18</td>\n",
       "      <td>66.04</td>\n",
       "      <td>62.14</td>\n",
       "      <td>6654.00</td>\n",
       "      <td>299.42</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>天津</td>\n",
       "      <td>天津</td>\n",
       "      <td>宁河区</td>\n",
       "      <td>市辖区</td>\n",
       "      <td>1414</td>\n",
       "      <td>40.00</td>\n",
       "      <td>20.21</td>\n",
       "      <td>19.79</td>\n",
       "      <td>525.37</td>\n",
       "      <td>49.57</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>天津</td>\n",
       "      <td>天津</td>\n",
       "      <td>静海区</td>\n",
       "      <td>市辖区</td>\n",
       "      <td>1476</td>\n",
       "      <td>59.79</td>\n",
       "      <td>30.35</td>\n",
       "      <td>29.44</td>\n",
       "      <td>667.83</td>\n",
       "      <td>79.29</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>天津</td>\n",
       "      <td>天津</td>\n",
       "      <td>蓟州区</td>\n",
       "      <td>市辖区</td>\n",
       "      <td>1593</td>\n",
       "      <td>86.24</td>\n",
       "      <td>43.86</td>\n",
       "      <td>42.38</td>\n",
       "      <td>392.55</td>\n",
       "      <td>91.15</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   省级单位 地级单位  县级单位 区划类型  行政面积（K㎡）  户籍人口（万人）     男性     女性  GDP（亿元）  常住人口（万人）\n",
       "0    天津   天津   和平区  市辖区        10     42.32  20.37  21.95   802.62     35.19\n",
       "1    天津   天津   河东区  市辖区        39     75.79  38.06  37.73   290.98     97.61\n",
       "2    天津   天津   河西区  市辖区        37     83.20  40.83  42.37   819.85     99.25\n",
       "3    天津   天津   南开区  市辖区        39     87.28  43.30  43.98   652.09    114.55\n",
       "4    天津   天津   河北区  市辖区        27     63.42  31.86  31.56   415.67     89.24\n",
       "5    天津   天津   红桥区  市辖区        21     51.66  25.93  25.73   208.16     56.69\n",
       "6    天津   天津   东丽区  市辖区       460     37.70  18.83  18.87   927.08     76.04\n",
       "7    天津   天津   西青区  市辖区       545     14.85  19.85  20.38  1040.27     85.37\n",
       "8    天津   天津   津南区  市辖区       401     44.83  22.35  22.48   810.16     89.41\n",
       "9    天津   天津   北辰区  市辖区       478     40.39  20.09  20.30  1058.14     98.38\n",
       "10   天津   天津   武清区  市辖区      1570     92.27  45.86  46.41  1151.65    119.96\n",
       "11   天津   天津   宝坻区  市辖区      1523     71.10  35.72  35.39   684.07     92.98\n",
       "12   天津   天津  滨海新区  市辖区      2270    128.18  66.04  62.14  6654.00    299.42\n",
       "13   天津   天津   宁河区  市辖区      1414     40.00  20.21  19.79   525.37     49.57\n",
       "14   天津   天津   静海区  市辖区      1476     59.79  30.35  29.44   667.83     79.29\n",
       "15   天津   天津   蓟州区  市辖区      1593     86.24  43.86  42.38   392.55     91.15"
      ]
     },
     "execution_count": 109,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "population=float(\"{:.2f}\".format(tj_37['常住人口（万人）'].mean()))\n",
    "values={'常住人口（万人）':population}\n",
    "tj_37=tj_37.fillna(value=values)\n",
    "tj_37\n",
    "#tj_37=tj_37.fillna({\"常住人口（万人）\":6666})\n",
    "#tj_37"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 对北京地区信息进行异常值检测。并且用箱型图进行表示"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 110,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.axes._subplots.AxesSubplot at 0xe5cce08>"
      ]
     },
     "execution_count": 110,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYQAAAD4CAYAAADsKpHdAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjMsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+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9B4fN5FHB/7nYtWE1qxSOpi3QByRV52nPs7F24SVJhPKOH1Co/Hvg4cHVEnAL8ETtblOR1zijudisqK1ye6v0vV7IhD9Kb9z+LXh9MuhzsAyXmFekg/7KisnNI3/sNqT/+oBLLHU269Ku4bAPpA/jJEvO+tYJ6Hz1O+euAr1cQ85Gks6Wjc9lPScluiHTFBaTBs7WkZuPYdexD+rDPz6/fCywtMd9S4P0VvheFuhyQ6/aSomnvInWz9RaVVVO/kv+vKj4nLyMl168Di4vKe0lXjyzNr1+Z67SQdOKwvuhxF/CHjfps1xDjJ0kHvBPHlE8H3tLq8RXFMw04suj1wbn+ha6dDaSWxybSlTvkffWnwAlFy72GdBL2bVLinJnLP0waqIV0kckK0qXt9wBn5/IFpBOLz+TPVfHjO6RLQL3/5Ye/y6hGua+7I1KLo+y8Mabf0MYnae8YM6CWz+SmR/MPFttukrRXpBtYrcGcEMzMDPCX25mZWeaEYGZmgBOCmZllTghmZgY4IZiZWfb/AbvTOgj6RXKkAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "import matplotlib.pyplot as plt\n",
    "plt.rcParams['font.sans-serif']=['SimHei']# 用来正常显示中文标签\n",
    "plt.rcParams['axes.unicode_minus']=False #用来正常显示负号\n",
    "bj_37.boxplot(column=['行政面积（K㎡）','户籍人口（万人）','男性','女性','GDP（亿元）','常住人口（万人）'])\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 95,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.axes._subplots.AxesSubplot at 0xe12d1c8>"
      ]
     },
     "execution_count": 95,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\ProgramData\\Anaconda3\\lib\\site-packages\\matplotlib\\backends\\backend_agg.py:211: RuntimeWarning: Glyph 34892 missing from current font.\n",
      "  font.set_text(s, 0.0, flags=flags)\n",
      "C:\\ProgramData\\Anaconda3\\lib\\site-packages\\matplotlib\\backends\\backend_agg.py:211: RuntimeWarning: Glyph 25919 missing from current font.\n",
      "  font.set_text(s, 0.0, flags=flags)\n",
      "C:\\ProgramData\\Anaconda3\\lib\\site-packages\\matplotlib\\backends\\backend_agg.py:211: RuntimeWarning: Glyph 38754 missing from current font.\n",
      "  font.set_text(s, 0.0, flags=flags)\n",
      "C:\\ProgramData\\Anaconda3\\lib\\site-packages\\matplotlib\\backends\\backend_agg.py:211: RuntimeWarning: Glyph 31215 missing from current font.\n",
      "  font.set_text(s, 0.0, flags=flags)\n",
      "C:\\ProgramData\\Anaconda3\\lib\\site-packages\\matplotlib\\backends\\backend_agg.py:211: RuntimeWarning: Glyph 65288 missing from current font.\n",
      "  font.set_text(s, 0.0, flags=flags)\n",
      "C:\\ProgramData\\Anaconda3\\lib\\site-packages\\matplotlib\\backends\\backend_agg.py:211: RuntimeWarning: Glyph 13217 missing from current font.\n",
      "  font.set_text(s, 0.0, flags=flags)\n",
      "C:\\ProgramData\\Anaconda3\\lib\\site-packages\\matplotlib\\backends\\backend_agg.py:211: RuntimeWarning: Glyph 65289 missing from current font.\n",
      "  font.set_text(s, 0.0, flags=flags)\n",
      "C:\\ProgramData\\Anaconda3\\lib\\site-packages\\matplotlib\\backends\\backend_agg.py:211: RuntimeWarning: Glyph 25143 missing from current font.\n",
      "  font.set_text(s, 0.0, flags=flags)\n",
      "C:\\ProgramData\\Anaconda3\\lib\\site-packages\\matplotlib\\backends\\backend_agg.py:211: RuntimeWarning: Glyph 31821 missing from current font.\n",
      "  font.set_text(s, 0.0, flags=flags)\n",
      "C:\\ProgramData\\Anaconda3\\lib\\site-packages\\matplotlib\\backends\\backend_agg.py:211: RuntimeWarning: Glyph 20154 missing from current font.\n",
      "  font.set_text(s, 0.0, flags=flags)\n",
      "C:\\ProgramData\\Anaconda3\\lib\\site-packages\\matplotlib\\backends\\backend_agg.py:211: RuntimeWarning: Glyph 21475 missing from current font.\n",
      "  font.set_text(s, 0.0, flags=flags)\n",
      "C:\\ProgramData\\Anaconda3\\lib\\site-packages\\matplotlib\\backends\\backend_agg.py:211: RuntimeWarning: Glyph 19975 missing from current font.\n",
      "  font.set_text(s, 0.0, flags=flags)\n",
      "C:\\ProgramData\\Anaconda3\\lib\\site-packages\\matplotlib\\backends\\backend_agg.py:211: RuntimeWarning: Glyph 30007 missing from current font.\n",
      "  font.set_text(s, 0.0, flags=flags)\n",
      "C:\\ProgramData\\Anaconda3\\lib\\site-packages\\matplotlib\\backends\\backend_agg.py:211: RuntimeWarning: Glyph 24615 missing from current font.\n",
      "  font.set_text(s, 0.0, flags=flags)\n",
      "C:\\ProgramData\\Anaconda3\\lib\\site-packages\\matplotlib\\backends\\backend_agg.py:211: RuntimeWarning: Glyph 22899 missing from current font.\n",
      "  font.set_text(s, 0.0, flags=flags)\n",
      "C:\\ProgramData\\Anaconda3\\lib\\site-packages\\matplotlib\\backends\\backend_agg.py:211: RuntimeWarning: Glyph 20159 missing from current font.\n",
      "  font.set_text(s, 0.0, flags=flags)\n",
      "C:\\ProgramData\\Anaconda3\\lib\\site-packages\\matplotlib\\backends\\backend_agg.py:211: RuntimeWarning: Glyph 20803 missing from current font.\n",
      "  font.set_text(s, 0.0, flags=flags)\n",
      "C:\\ProgramData\\Anaconda3\\lib\\site-packages\\matplotlib\\backends\\backend_agg.py:211: RuntimeWarning: Glyph 24120 missing from current font.\n",
      "  font.set_text(s, 0.0, flags=flags)\n",
      "C:\\ProgramData\\Anaconda3\\lib\\site-packages\\matplotlib\\backends\\backend_agg.py:211: RuntimeWarning: Glyph 20303 missing from current font.\n",
      "  font.set_text(s, 0.0, flags=flags)\n",
      "C:\\ProgramData\\Anaconda3\\lib\\site-packages\\matplotlib\\backends\\backend_agg.py:180: RuntimeWarning: Glyph 34892 missing from current font.\n",
      "  font.set_text(s, 0, flags=flags)\n",
      "C:\\ProgramData\\Anaconda3\\lib\\site-packages\\matplotlib\\backends\\backend_agg.py:180: RuntimeWarning: Glyph 25919 missing from current font.\n",
      "  font.set_text(s, 0, flags=flags)\n",
      "C:\\ProgramData\\Anaconda3\\lib\\site-packages\\matplotlib\\backends\\backend_agg.py:180: RuntimeWarning: Glyph 38754 missing from current font.\n",
      "  font.set_text(s, 0, flags=flags)\n",
      "C:\\ProgramData\\Anaconda3\\lib\\site-packages\\matplotlib\\backends\\backend_agg.py:180: RuntimeWarning: Glyph 31215 missing from current font.\n",
      "  font.set_text(s, 0, flags=flags)\n",
      "C:\\ProgramData\\Anaconda3\\lib\\site-packages\\matplotlib\\backends\\backend_agg.py:180: RuntimeWarning: Glyph 65288 missing from current font.\n",
      "  font.set_text(s, 0, flags=flags)\n",
      "C:\\ProgramData\\Anaconda3\\lib\\site-packages\\matplotlib\\backends\\backend_agg.py:180: RuntimeWarning: Glyph 13217 missing from current font.\n",
      "  font.set_text(s, 0, flags=flags)\n",
      "C:\\ProgramData\\Anaconda3\\lib\\site-packages\\matplotlib\\backends\\backend_agg.py:180: RuntimeWarning: Glyph 65289 missing from current font.\n",
      "  font.set_text(s, 0, flags=flags)\n",
      "C:\\ProgramData\\Anaconda3\\lib\\site-packages\\matplotlib\\backends\\backend_agg.py:180: RuntimeWarning: Glyph 25143 missing from current font.\n",
      "  font.set_text(s, 0, flags=flags)\n",
      "C:\\ProgramData\\Anaconda3\\lib\\site-packages\\matplotlib\\backends\\backend_agg.py:180: RuntimeWarning: Glyph 31821 missing from current font.\n",
      "  font.set_text(s, 0, flags=flags)\n",
      "C:\\ProgramData\\Anaconda3\\lib\\site-packages\\matplotlib\\backends\\backend_agg.py:180: RuntimeWarning: Glyph 20154 missing from current font.\n",
      "  font.set_text(s, 0, flags=flags)\n",
      "C:\\ProgramData\\Anaconda3\\lib\\site-packages\\matplotlib\\backends\\backend_agg.py:180: RuntimeWarning: Glyph 21475 missing from current font.\n",
      "  font.set_text(s, 0, flags=flags)\n",
      "C:\\ProgramData\\Anaconda3\\lib\\site-packages\\matplotlib\\backends\\backend_agg.py:180: RuntimeWarning: Glyph 19975 missing from current font.\n",
      "  font.set_text(s, 0, flags=flags)\n",
      "C:\\ProgramData\\Anaconda3\\lib\\site-packages\\matplotlib\\backends\\backend_agg.py:180: RuntimeWarning: Glyph 30007 missing from current font.\n",
      "  font.set_text(s, 0, flags=flags)\n",
      "C:\\ProgramData\\Anaconda3\\lib\\site-packages\\matplotlib\\backends\\backend_agg.py:180: RuntimeWarning: Glyph 24615 missing from current font.\n",
      "  font.set_text(s, 0, flags=flags)\n",
      "C:\\ProgramData\\Anaconda3\\lib\\site-packages\\matplotlib\\backends\\backend_agg.py:180: RuntimeWarning: Glyph 22899 missing from current font.\n",
      "  font.set_text(s, 0, flags=flags)\n",
      "C:\\ProgramData\\Anaconda3\\lib\\site-packages\\matplotlib\\backends\\backend_agg.py:180: RuntimeWarning: Glyph 20159 missing from current font.\n",
      "  font.set_text(s, 0, flags=flags)\n",
      "C:\\ProgramData\\Anaconda3\\lib\\site-packages\\matplotlib\\backends\\backend_agg.py:180: RuntimeWarning: Glyph 20803 missing from current font.\n",
      "  font.set_text(s, 0, flags=flags)\n",
      "C:\\ProgramData\\Anaconda3\\lib\\site-packages\\matplotlib\\backends\\backend_agg.py:180: RuntimeWarning: Glyph 24120 missing from current font.\n",
      "  font.set_text(s, 0, flags=flags)\n",
      "C:\\ProgramData\\Anaconda3\\lib\\site-packages\\matplotlib\\backends\\backend_agg.py:180: RuntimeWarning: Glyph 20303 missing from current font.\n",
      "  font.set_text(s, 0, flags=flags)\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAX0AAAD4CAYAAAAAczaOAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjMsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+AADFEAAAVAklEQVR4nO3df4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xv2vwH4ArAxM1+MiOc58//7XpWZvzJbe7fWuFDtjT+rxdTKz6iuMS2kbq4vpv8R7FeAXZn5b6q2K4CPAa8B38zMm6r2a4CvRMTPMnN/dRf3ZuYfREQ/8M2IeDdwlBYeR4vxuKvGezcFPPaWVOhXtmTmjwEi4mLgt2Zpm61vO+1ExIeA/wbcmJl/XTXvzczGPn84T3s317hgP6uatPIzWoq6tb4PA/8nM//4dENmvgB8ISIGGztm5tMR8RngNmD/WesmI+Ik059UbfVxtFiPOyjgsef0TnPeCjwI3JyZf9XpwUgdtBb4Tgv9vwP8k7MbI+I64BTwtws0LjXJ0G/OL4D/CYx0eiBSN4mI+yLiuxHxxGxdzlr+DxHxNPAHwL9OzxmvnaHfnFPAvwL+WUT8bqcHI3XQs8D7Ty9k5q3ABmDGL/cC3gdMNizfm5nXZOaHMvObizdMzcbQb1Jm/hS4Cfj1iPCIX6U6ALwtIv5dQ9s/mqljRPxT4D8C99UxMDVnKb6R2zGZeTwiNgHfiIhe/hpYaUaZmRFxM3BvRPwO03PyrwN3VF0+FBFPMf1E8Crw7xvO3FEXMPSbkJkXNNx+CbgSICKGOjYoqUMy8xVgyyyrL5pju7sXZUBqyVIL/VeBL0XEqWr5LcCjs7SxgO2zGYiIrzQsXzJPezM6VeNi/6wWUqs/o6Wm1+s7W6uPo8V43EEhjz2/cE2SCuIbuZJUEENfkgpi6EtSQQx9SSqIoS9JBfm/AgYy5OGFjFYAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "bj_37.boxplot()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 对天津地区信息进行异常值检测。并且用箱型图进行表示"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 114,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.axes._subplots.AxesSubplot at 0xef3f848>"
      ]
     },
     "execution_count": 114,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYQAAAD4CAYAAADsKpHdAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjMsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+AADFEAAAbN0lEQVR4nO3df3xkdX3v8dd7fwDrBhAEU0Hlx5VegwsLbEr5ETTjAgV/8LBcVCJVF+NdveJSvdWy3uAPlFWKP65CQViNC2pJSu0VEXBFJEHWgtcNiKxNa2kFLd6WtuCu4YKy8Okf329gNiSZM5NkMjP7fj4e89jM95w55/vZmTnvc77nzIwiAjMzswXz3QEzM2sMDgQzMwMcCGZmljkQzMwMcCCYmVm2aL47MG6fffaJAw88sG7re/TRR1m6dGnd1ldvrq+5tXJ9rVwb1L++kZGRf4+IfWdjWQ0TCAceeCCbN2+u2/qGh4fp7u6u2/rqzfU1t1aur5Vrg/rXJ+mB2VqWh4zMzAxwIJiZWeZAMDMzwIFgZmaZA8HMzAAHgpnVycDAAMuWLWPlypUsW7aMgYGB+e6STdAwl52aWesaGBigr6+P/v5+nnzySRYuXEhvby8APT0989w7G+cjBDObc+vWraO/v59SqcSiRYsolUr09/ezbt26+e6alXEgmNmcGx0dpaura4e2rq4uRkdH56lHNhkHgpnNuY6ODjZt2rRD26ZNm+jo6JinHtlkHAhmNuf6+vro7e1laGiI7du3MzQ0RG9vL319ffPdNSvjk8pmNufGTxyvWbOG0dFROjo6WLdunU8oNxgHgpnVRU9PDz09PS3/5XbNzENGZmYGOBDMzCxzIJiZGeBAMDOzzIFgZmaAA8HMzDIHgpmZAQ4EMzPLHAhmZgY4EMzMLHMgmJkZ4EAwM7PMgWBmZkAVgSDpckmvzX/3S7pD0vll0wu1mZlZYyoUCJJOAH4nIr4p6XRgYUQcCxws6ZCibXNWh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ijpOeSnvNbq1zet0gbagDK93bzztrJlB1hSFqR31PjXpX7tIPyefK5xKtJR9unAScB7wM+JunrEx9bid9/9f0cwmSJVX7J1VnAzaQnuJMUILcA5wNPSLo5n0wc99ek8wefIF3WuYp0FAJARHw+n7waX+8nSSd0HgQuAVbm/+BJRcRtwFOS3j2h/R+B75Fe7L8L/FWetAkYT/gbgW2SOklHKUPAwaRA2UYaH32cNNaZ/nOkM0kBdkbZXtWbgTdK+koOTHI9a/XMZbfjl9uupcJewWQ1SXotafz4i/m+lC5b22HPrWj/JPWSxo+/NV1fKvRzex5jv4Z0Ana8D/sDvxy/+0x3d7x0T+nSw4b90KWkXfNr+eOkse8jSBuE/yPpM5J2o/71XQ/8TNIdpI01pL3vjcB5EfF31SwsIr4M/L7S1Tzjxl+fhwN35GHXcetJR/FI6iBdQHJhnvYUz4wuXCVp/HxGF+mo/Fjgo8DnIuJE4PU8c0RJXuai8mG3srbxy1P9/sudrMuN9OT977L7+5EuB3vvJPOKtJF/UVnbaaTv/YY0Hr/PJI87gnTpV3nbEOkFePEk8/5RgX4fMUX7a4FvFKj5MNLe0hG57T5S2A2TrriAdPJskHTYOHEZu5Fe7C/L988FVk0y3yrgPQWfi/G+7J379oKyae8gDbN1l7VV079J/7+qeJ28iBSu3wBWlrV3k64eWZXvvyT3aTlpx2Fj2e1m4A/q9dquocaLSRu8Eya0LwTe1Oz1ldWzADis7P5+uf/jQztDpCOPzaQrd8jv1fuA48sedxxpJ+xOUnDukts/QDpRC+kikzWkS9tvBV6T25eRdiw+nV9X5bcfkC4B9fsv3/xdRjXKY91tkY44Ks4bE8YNbWqSdo0JJ9TyntzCaPyTxTZDkhZH+gCr1ZkDwczMAH+5nZmZZQ4EMzMDHAhmZpY5EMzMDHAgmJlZ9p9PjV4/AFMAyAAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.rcParams['font.sans-serif']=['SimHei']# 用来正常显示中文标签\n",
    "plt.rcParams['axes.unicode_minus']=False #用来正常显示负号\n",
    "tj_37.boxplot(column=['行政面积（K㎡）','户籍人口（万人）','男性','女性','GDP（亿元）','常住人口（万人）'])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 96,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.axes._subplots.AxesSubplot at 0xe1c1e48>"
      ]
     },
     "execution_count": 96,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\ProgramData\\Anaconda3\\lib\\site-packages\\matplotlib\\backends\\backend_agg.py:211: RuntimeWarning: Glyph 34892 missing from current font.\n",
      "  font.set_text(s, 0.0, flags=flags)\n",
      "C:\\ProgramData\\Anaconda3\\lib\\site-packages\\matplotlib\\backends\\backend_agg.py:211: RuntimeWarning: Glyph 25919 missing from current font.\n",
      "  font.set_text(s, 0.0, flags=flags)\n",
      "C:\\ProgramData\\Anaconda3\\lib\\site-packages\\matplotlib\\backends\\backend_agg.py:211: RuntimeWarning: Glyph 38754 missing from current font.\n",
      "  font.set_text(s, 0.0, flags=flags)\n",
      "C:\\ProgramData\\Anaconda3\\lib\\site-packages\\matplotlib\\backends\\backend_agg.py:211: RuntimeWarning: Glyph 31215 missing from current font.\n",
      "  font.set_text(s, 0.0, flags=flags)\n",
      "C:\\ProgramData\\Anaconda3\\lib\\site-packages\\matplotlib\\backends\\backend_agg.py:211: RuntimeWarning: Glyph 65288 missing from current font.\n",
      "  font.set_text(s, 0.0, flags=flags)\n",
      "C:\\ProgramData\\Anaconda3\\lib\\site-packages\\matplotlib\\backends\\backend_agg.py:211: RuntimeWarning: Glyph 13217 missing from current font.\n",
      "  font.set_text(s, 0.0, flags=flags)\n",
      "C:\\ProgramData\\Anaconda3\\lib\\site-packages\\matplotlib\\backends\\backend_agg.py:211: RuntimeWarning: Glyph 65289 missing from current font.\n",
      "  font.set_text(s, 0.0, flags=flags)\n",
      "C:\\ProgramData\\Anaconda3\\lib\\site-packages\\matplotlib\\backends\\backend_agg.py:211: RuntimeWarning: Glyph 25143 missing from current font.\n",
      "  font.set_text(s, 0.0, flags=flags)\n",
      "C:\\ProgramData\\Anaconda3\\lib\\site-packages\\matplotlib\\backends\\backend_agg.py:211: RuntimeWarning: Glyph 31821 missing from current font.\n",
      "  font.set_text(s, 0.0, flags=flags)\n",
      "C:\\ProgramData\\Anaconda3\\lib\\site-packages\\matplotlib\\backends\\backend_agg.py:211: RuntimeWarning: Glyph 20154 missing from current font.\n",
      "  font.set_text(s, 0.0, flags=flags)\n",
      "C:\\ProgramData\\Anaconda3\\lib\\site-packages\\matplotlib\\backends\\backend_agg.py:211: RuntimeWarning: Glyph 21475 missing from current font.\n",
      "  font.set_text(s, 0.0, flags=flags)\n",
      "C:\\ProgramData\\Anaconda3\\lib\\site-packages\\matplotlib\\backends\\backend_agg.py:211: RuntimeWarning: Glyph 19975 missing from current font.\n",
      "  font.set_text(s, 0.0, flags=flags)\n",
      "C:\\ProgramData\\Anaconda3\\lib\\site-packages\\matplotlib\\backends\\backend_agg.py:211: RuntimeWarning: Glyph 30007 missing from current font.\n",
      "  font.set_text(s, 0.0, flags=flags)\n",
      "C:\\ProgramData\\Anaconda3\\lib\\site-packages\\matplotlib\\backends\\backend_agg.py:211: RuntimeWarning: Glyph 24615 missing from current font.\n",
      "  font.set_text(s, 0.0, flags=flags)\n",
      "C:\\ProgramData\\Anaconda3\\lib\\site-packages\\matplotlib\\backends\\backend_agg.py:211: RuntimeWarning: Glyph 22899 missing from current font.\n",
      "  font.set_text(s, 0.0, flags=flags)\n",
      "C:\\ProgramData\\Anaconda3\\lib\\site-packages\\matplotlib\\backends\\backend_agg.py:211: RuntimeWarning: Glyph 20159 missing from current font.\n",
      "  font.set_text(s, 0.0, flags=flags)\n",
      "C:\\ProgramData\\Anaconda3\\lib\\site-packages\\matplotlib\\backends\\backend_agg.py:211: RuntimeWarning: Glyph 20803 missing from current font.\n",
      "  font.set_text(s, 0.0, flags=flags)\n",
      "C:\\ProgramData\\Anaconda3\\lib\\site-packages\\matplotlib\\backends\\backend_agg.py:211: RuntimeWarning: Glyph 24120 missing from current font.\n",
      "  font.set_text(s, 0.0, flags=flags)\n",
      "C:\\ProgramData\\Anaconda3\\lib\\site-packages\\matplotlib\\backends\\backend_agg.py:211: RuntimeWarning: Glyph 20303 missing from current font.\n",
      "  font.set_text(s, 0.0, flags=flags)\n",
      "C:\\ProgramData\\Anaconda3\\lib\\site-packages\\matplotlib\\backends\\backend_agg.py:180: RuntimeWarning: Glyph 34892 missing from current font.\n",
      "  font.set_text(s, 0, flags=flags)\n",
      "C:\\ProgramData\\Anaconda3\\lib\\site-packages\\matplotlib\\backends\\backend_agg.py:180: RuntimeWarning: Glyph 25919 missing from current font.\n",
      "  font.set_text(s, 0, flags=flags)\n",
      "C:\\ProgramData\\Anaconda3\\lib\\site-packages\\matplotlib\\backends\\backend_agg.py:180: RuntimeWarning: Glyph 38754 missing from current font.\n",
      "  font.set_text(s, 0, flags=flags)\n",
      "C:\\ProgramData\\Anaconda3\\lib\\site-packages\\matplotlib\\backends\\backend_agg.py:180: RuntimeWarning: Glyph 31215 missing from current font.\n",
      "  font.set_text(s, 0, flags=flags)\n",
      "C:\\ProgramData\\Anaconda3\\lib\\site-packages\\matplotlib\\backends\\backend_agg.py:180: RuntimeWarning: Glyph 65288 missing from current font.\n",
      "  font.set_text(s, 0, flags=flags)\n",
      "C:\\ProgramData\\Anaconda3\\lib\\site-packages\\matplotlib\\backends\\backend_agg.py:180: RuntimeWarning: Glyph 13217 missing from current font.\n",
      "  font.set_text(s, 0, flags=flags)\n",
      "C:\\ProgramData\\Anaconda3\\lib\\site-packages\\matplotlib\\backends\\backend_agg.py:180: RuntimeWarning: Glyph 65289 missing from current font.\n",
      "  font.set_text(s, 0, flags=flags)\n",
      "C:\\ProgramData\\Anaconda3\\lib\\site-packages\\matplotlib\\backends\\backend_agg.py:180: RuntimeWarning: Glyph 25143 missing from current font.\n",
      "  font.set_text(s, 0, flags=flags)\n",
      "C:\\ProgramData\\Anaconda3\\lib\\site-packages\\matplotlib\\backends\\backend_agg.py:180: RuntimeWarning: Glyph 31821 missing from current font.\n",
      "  font.set_text(s, 0, flags=flags)\n",
      "C:\\ProgramData\\Anaconda3\\lib\\site-packages\\matplotlib\\backends\\backend_agg.py:180: RuntimeWarning: Glyph 20154 missing from current font.\n",
      "  font.set_text(s, 0, flags=flags)\n",
      "C:\\ProgramData\\Anaconda3\\lib\\site-packages\\matplotlib\\backends\\backend_agg.py:180: RuntimeWarning: Glyph 21475 missing from current font.\n",
      "  font.set_text(s, 0, flags=flags)\n",
      "C:\\ProgramData\\Anaconda3\\lib\\site-packages\\matplotlib\\backends\\backend_agg.py:180: RuntimeWarning: Glyph 19975 missing from current font.\n",
      "  font.set_text(s, 0, flags=flags)\n",
      "C:\\ProgramData\\Anaconda3\\lib\\site-packages\\matplotlib\\backends\\backend_agg.py:180: RuntimeWarning: Glyph 30007 missing from current font.\n",
      "  font.set_text(s, 0, flags=flags)\n",
      "C:\\ProgramData\\Anaconda3\\lib\\site-packages\\matplotlib\\backends\\backend_agg.py:180: RuntimeWarning: Glyph 24615 missing from current font.\n",
      "  font.set_text(s, 0, flags=flags)\n",
      "C:\\ProgramData\\Anaconda3\\lib\\site-packages\\matplotlib\\backends\\backend_agg.py:180: RuntimeWarning: Glyph 22899 missing from current font.\n",
      "  font.set_text(s, 0, flags=flags)\n",
      "C:\\ProgramData\\Anaconda3\\lib\\site-packages\\matplotlib\\backends\\backend_agg.py:180: RuntimeWarning: Glyph 20159 missing from current font.\n",
      "  font.set_text(s, 0, flags=flags)\n",
      "C:\\ProgramData\\Anaconda3\\lib\\site-packages\\matplotlib\\backends\\backend_agg.py:180: RuntimeWarning: Glyph 20803 missing from current font.\n",
      "  font.set_text(s, 0, flags=flags)\n",
      "C:\\ProgramData\\Anaconda3\\lib\\site-packages\\matplotlib\\backends\\backend_agg.py:180: RuntimeWarning: Glyph 24120 missing from current font.\n",
      "  font.set_text(s, 0, flags=flags)\n",
      "C:\\ProgramData\\Anaconda3\\lib\\site-packages\\matplotlib\\backends\\backend_agg.py:180: RuntimeWarning: Glyph 20303 missing from current font.\n",
      "  font.set_text(s, 0, flags=flags)\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAX0AAAD4CAYAAAAAczaOAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjMsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+AADFEAAAWAklEQVR4nO3dfYxcV33G8e+DHV6apHHSkFVkp7ErrHbBNC9sk1SYahe3jgkRTiXSelOBG21lqQoGKqQmsKocAlsFCTUQFGhd1qmDyJqIFmKFKMGydwRWm5CEhGBnQTYBksUuprXjsglvTn79Y87C2JnZndmdvfNyno+02rm/e+7c87M1z9y9c2dGEYGZmeXhFa2egJmZFcehb2aWEYe+mVlGHPpmZhlx6JuZZWRxqycwk3PPPTeWL19e2P6ef/55Tj/99ML2VzT319m6ub9u7g2K7++xxx77n4h4bbV1bR36y5cv59FHHy1sf6VSif7+/sL2VzT319m6ub9u7g2K70/SD2ut8+kdM7OMOPTNzDLi0Dczy4hD38wsIw59M7OMOPTNzBbI2NgYq1atYs2aNaxatYqxsbFWT6m9L9k0s+42NjbGyMgIExMT9Pb2Mjw8zODgYKun1RRjY2MMDw8zOjrKiy++yKJFixgaGgJoaY8OfTNriXYNxWYZGRlhdHSUgYGBX1+nPzo6yubNm1van0/vmFlLVIbi4sWLGRgYYHR0lJGRkVZPrSkmJiZYvXr1SbXVq1czMTHRohmVOfTNrCXaNRSbpbe3l717955U27t3L729vS2aUZlD38xaol1DsVmGh4cZGhpifHycEydOMD4+ztDQEMPDwy2dl8/pm1lLTIfi9Dn96VDsltM70+ftN2/e/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Q9K3JD1Sa8gpy38n6Qng48Bfhq8ZL5xDvz4vAX8B/JGkD7V6MmYttB+4dHohIm4A1gBVP9wLuASYqFi+LSIujoi3RMTXF26aVotDv04R8QJwNfBXknzEb7naA7xa0t9W1H6r2kBJfwj8A3BHEROz+nTiC7ktExFHJa0Dviapmz8G1qyqiAhJ1wC3Sfp7yufknwduTEPeIulxyk8ER4D3Vly5Y23AoV+HiDij4vazwAoASQMtm5RZi0TEYWBDjdVnzbDdzQsyIWtIp4X+EeAuSS+l5VcAD9So0cR6LX2SvlyxfO4s9Xq0qseF/rdqpkb/jTpNt/d3qkYfRwvxuINMHnv+wDUzs4z4hVwzs4w49M3MMuLQNzPLiEPfzCwjDn0zs4z8P5y4fzhGhyJHAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "tj_37.boxplot()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 对两地数据进行合并"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 97,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>省级单位</th>\n",
       "      <th>地级单位</th>\n",
       "      <th>县级单位</th>\n",
       "      <th>区划类型</th>\n",
       "      <th>行政面积（K㎡）</th>\n",
       "      <th>户籍人口（万人）</th>\n",
       "      <th>男性</th>\n",
       "      <th>女性</th>\n",
       "      <th>GDP（亿元）</th>\n",
       "      <th>常住人口（万人）</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>北京</td>\n",
       "      <td>北京</td>\n",
       "      <td>西城区</td>\n",
       "      <td>市辖区</td>\n",
       "      <td>51</td>\n",
       "      <td>146.47</td>\n",
       "      <td>72.88</td>\n",
       "      <td>73.59</td>\n",
       "      <td>3602.36</td>\n",
       "      <td>125.90</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>北京</td>\n",
       "      <td>北京</td>\n",
       "      <td>东城区</td>\n",
       "      <td>市辖区</td>\n",
       "      <td>42</td>\n",
       "      <td>97.41</td>\n",
       "      <td>47.91</td>\n",
       "      <td>49.50</td>\n",
       "      <td>2061.80</td>\n",
       "      <td>87.80</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>北京</td>\n",
       "      <td>北京</td>\n",
       "      <td>丰台区</td>\n",
       "      <td>市辖区</td>\n",
       "      <td>306</td>\n",
       "      <td>115.33</td>\n",
       "      <td>58.39</td>\n",
       "      <td>56.95</td>\n",
       "      <td>1297.03</td>\n",
       "      <td>225.50</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>北京</td>\n",
       "      <td>北京</td>\n",
       "      <td>西城区</td>\n",
       "      <td>市辖区</td>\n",
       "      <td>51</td>\n",
       "      <td>146.47</td>\n",
       "      <td>72.88</td>\n",
       "      <td>73.59</td>\n",
       "      <td>3602.36</td>\n",
       "      <td>125.90</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>北京</td>\n",
       "      <td>北京</td>\n",
       "      <td>朝阳区</td>\n",
       "      <td>市辖区</td>\n",
       "      <td>455</td>\n",
       "      <td>210.91</td>\n",
       "      <td>105.43</td>\n",
       "      <td>105.48</td>\n",
       "      <td>5171.03</td>\n",
       "      <td>385.60</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>北京</td>\n",
       "      <td>北京</td>\n",
       "      <td>房山区</td>\n",
       "      <td>市辖区</td>\n",
       "      <td>1990</td>\n",
       "      <td>81.28</td>\n",
       "      <td>40.76</td>\n",
       "      <td>40.52</td>\n",
       "      <td>606.61</td>\n",
       "      <td>109.60</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>北京</td>\n",
       "      <td>北京</td>\n",
       "      <td>丰台区</td>\n",
       "      <td>市辖区</td>\n",
       "      <td>306</td>\n",
       "      <td>115.33</td>\n",
       "      <td>58.39</td>\n",
       "      <td>56.95</td>\n",
       "      <td>1297.03</td>\n",
       "      <td>225.50</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>北京</td>\n",
       "      <td>北京</td>\n",
       "      <td>石景山区</td>\n",
       "      <td>市辖区</td>\n",
       "      <td>84</td>\n",
       "      <td>38.69</td>\n",
       "      <td>19.87</td>\n",
       "      <td>18.82</td>\n",
       "      <td>482.14</td>\n",
       "      <td>63.40</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>北京</td>\n",
       "      <td>北京</td>\n",
       "      <td>海淀区</td>\n",
       "      <td>市辖区</td>\n",
       "      <td>431</td>\n",
       "      <td>240.20</td>\n",
       "      <td>120.08</td>\n",
       "      <td>120.12</td>\n",
       "      <td>5395.16</td>\n",
       "      <td>359.30</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>北京</td>\n",
       "      <td>北京</td>\n",
       "      <td>房山区</td>\n",
       "      <td>市辖区</td>\n",
       "      <td>1990</td>\n",
       "      <td>81.28</td>\n",
       "      <td>40.76</td>\n",
       "      <td>40.52</td>\n",
       "      <td>606.61</td>\n",
       "      <td>109.60</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>北京</td>\n",
       "      <td>北京</td>\n",
       "      <td>通州区</td>\n",
       "      <td>市辖区</td>\n",
       "      <td>906</td>\n",
       "      <td>74.68</td>\n",
       "      <td>37.08</td>\n",
       "      <td>37.60</td>\n",
       "      <td>674.81</td>\n",
       "      <td>142.80</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>北京</td>\n",
       "      <td>北京</td>\n",
       "      <td>顺义区</td>\n",
       "      <td>市辖区</td>\n",
       "      <td>1020</td>\n",
       "      <td>62.74</td>\n",
       "      <td>31.12</td>\n",
       "      <td>31.61</td>\n",
       "      <td>1591.60</td>\n",
       "      <td>107.50</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>北京</td>\n",
       "      <td>北京</td>\n",
       "      <td>昌平区</td>\n",
       "      <td>市辖区</td>\n",
       "      <td>1344</td>\n",
       "      <td>61.14</td>\n",
       "      <td>30.72</td>\n",
       "      <td>30.41</td>\n",
       "      <td>753.39</td>\n",
       "      <td>201.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>北京</td>\n",
       "      <td>北京</td>\n",
       "      <td>大兴区</td>\n",
       "      <td>市辖区</td>\n",
       "      <td>1036</td>\n",
       "      <td>68.38</td>\n",
       "      <td>34.02</td>\n",
       "      <td>34.36</td>\n",
       "      <td>1796.95</td>\n",
       "      <td>169.40</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>北京</td>\n",
       "      <td>北京</td>\n",
       "      <td>门头沟区</td>\n",
       "      <td>市辖区</td>\n",
       "      <td>1451</td>\n",
       "      <td>25.12</td>\n",
       "      <td>12.80</td>\n",
       "      <td>12.32</td>\n",
       "      <td>157.86</td>\n",
       "      <td>31.10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>北京</td>\n",
       "      <td>北京</td>\n",
       "      <td>怀柔区</td>\n",
       "      <td>市辖区</td>\n",
       "      <td>2123</td>\n",
       "      <td>28.29</td>\n",
       "      <td>14.13</td>\n",
       "      <td>14.16</td>\n",
       "      <td>259.41</td>\n",
       "      <td>39.30</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>北京</td>\n",
       "      <td>北京</td>\n",
       "      <td>平谷区</td>\n",
       "      <td>市辖区</td>\n",
       "      <td>950</td>\n",
       "      <td>40.20</td>\n",
       "      <td>20.22</td>\n",
       "      <td>19.98</td>\n",
       "      <td>218.31</td>\n",
       "      <td>43.70</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>北京</td>\n",
       "      <td>北京</td>\n",
       "      <td>密云区</td>\n",
       "      <td>市辖区</td>\n",
       "      <td>2229</td>\n",
       "      <td>43.59</td>\n",
       "      <td>21.77</td>\n",
       "      <td>21.82</td>\n",
       "      <td>251.13</td>\n",
       "      <td>48.30</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>北京</td>\n",
       "      <td>北京</td>\n",
       "      <td>延庆区</td>\n",
       "      <td>市辖区</td>\n",
       "      <td>1994</td>\n",
       "      <td>28.42</td>\n",
       "      <td>14.32</td>\n",
       "      <td>14.11</td>\n",
       "      <td>122.66</td>\n",
       "      <td>32.70</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>天津</td>\n",
       "      <td>天津</td>\n",
       "      <td>和平区</td>\n",
       "      <td>市辖区</td>\n",
       "      <td>10</td>\n",
       "      <td>42.32</td>\n",
       "      <td>20.37</td>\n",
       "      <td>21.95</td>\n",
       "      <td>802.62</td>\n",
       "      <td>35.19</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20</th>\n",
       "      <td>天津</td>\n",
       "      <td>天津</td>\n",
       "      <td>河东区</td>\n",
       "      <td>市辖区</td>\n",
       "      <td>39</td>\n",
       "      <td>75.79</td>\n",
       "      <td>38.06</td>\n",
       "      <td>37.73</td>\n",
       "      <td>290.98</td>\n",
       "      <td>97.61</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21</th>\n",
       "      <td>天津</td>\n",
       "      <td>天津</td>\n",
       "      <td>河西区</td>\n",
       "      <td>市辖区</td>\n",
       "      <td>37</td>\n",
       "      <td>83.20</td>\n",
       "      <td>40.83</td>\n",
       "      <td>42.37</td>\n",
       "      <td>819.85</td>\n",
       "      <td>99.25</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>22</th>\n",
       "      <td>天津</td>\n",
       "      <td>天津</td>\n",
       "      <td>南开区</td>\n",
       "      <td>市辖区</td>\n",
       "      <td>39</td>\n",
       "      <td>87.28</td>\n",
       "      <td>43.30</td>\n",
       "      <td>43.98</td>\n",
       "      <td>652.09</td>\n",
       "      <td>114.55</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>23</th>\n",
       "      <td>天津</td>\n",
       "      <td>天津</td>\n",
       "      <td>河北区</td>\n",
       "      <td>市辖区</td>\n",
       "      <td>27</td>\n",
       "      <td>63.42</td>\n",
       "      <td>31.86</td>\n",
       "      <td>31.56</td>\n",
       "      <td>415.67</td>\n",
       "      <td>89.24</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24</th>\n",
       "      <td>天津</td>\n",
       "      <td>天津</td>\n",
       "      <td>红桥区</td>\n",
       "      <td>市辖区</td>\n",
       "      <td>21</td>\n",
       "      <td>51.66</td>\n",
       "      <td>25.93</td>\n",
       "      <td>25.73</td>\n",
       "      <td>208.16</td>\n",
       "      <td>56.69</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25</th>\n",
       "      <td>天津</td>\n",
       "      <td>天津</td>\n",
       "      <td>东丽区</td>\n",
       "      <td>市辖区</td>\n",
       "      <td>460</td>\n",
       "      <td>37.70</td>\n",
       "      <td>18.83</td>\n",
       "      <td>18.87</td>\n",
       "      <td>927.08</td>\n",
       "      <td>76.04</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>26</th>\n",
       "      <td>天津</td>\n",
       "      <td>天津</td>\n",
       "      <td>西青区</td>\n",
       "      <td>市辖区</td>\n",
       "      <td>545</td>\n",
       "      <td>14.85</td>\n",
       "      <td>19.85</td>\n",
       "      <td>20.38</td>\n",
       "      <td>1040.27</td>\n",
       "      <td>85.37</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>27</th>\n",
       "      <td>天津</td>\n",
       "      <td>天津</td>\n",
       "      <td>津南区</td>\n",
       "      <td>市辖区</td>\n",
       "      <td>401</td>\n",
       "      <td>44.83</td>\n",
       "      <td>22.35</td>\n",
       "      <td>22.48</td>\n",
       "      <td>810.16</td>\n",
       "      <td>89.41</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>28</th>\n",
       "      <td>天津</td>\n",
       "      <td>天津</td>\n",
       "      <td>北辰区</td>\n",
       "      <td>市辖区</td>\n",
       "      <td>478</td>\n",
       "      <td>40.39</td>\n",
       "      <td>20.09</td>\n",
       "      <td>20.30</td>\n",
       "      <td>1058.14</td>\n",
       "      <td>6666.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>29</th>\n",
       "      <td>天津</td>\n",
       "      <td>天津</td>\n",
       "      <td>武清区</td>\n",
       "      <td>市辖区</td>\n",
       "      <td>1570</td>\n",
       "      <td>92.27</td>\n",
       "      <td>45.86</td>\n",
       "      <td>46.41</td>\n",
       "      <td>1151.65</td>\n",
       "      <td>119.96</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>30</th>\n",
       "      <td>天津</td>\n",
       "      <td>天津</td>\n",
       "      <td>宝坻区</td>\n",
       "      <td>市辖区</td>\n",
       "      <td>1523</td>\n",
       "      <td>71.10</td>\n",
       "      <td>35.72</td>\n",
       "      <td>35.39</td>\n",
       "      <td>684.07</td>\n",
       "      <td>92.98</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>31</th>\n",
       "      <td>天津</td>\n",
       "      <td>天津</td>\n",
       "      <td>滨海新区</td>\n",
       "      <td>市辖区</td>\n",
       "      <td>2270</td>\n",
       "      <td>128.18</td>\n",
       "      <td>66.04</td>\n",
       "      <td>62.14</td>\n",
       "      <td>6654.00</td>\n",
       "      <td>299.42</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32</th>\n",
       "      <td>天津</td>\n",
       "      <td>天津</td>\n",
       "      <td>宁河区</td>\n",
       "      <td>市辖区</td>\n",
       "      <td>1414</td>\n",
       "      <td>40.00</td>\n",
       "      <td>20.21</td>\n",
       "      <td>19.79</td>\n",
       "      <td>525.37</td>\n",
       "      <td>49.57</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>33</th>\n",
       "      <td>天津</td>\n",
       "      <td>天津</td>\n",
       "      <td>静海区</td>\n",
       "      <td>市辖区</td>\n",
       "      <td>1476</td>\n",
       "      <td>59.79</td>\n",
       "      <td>30.35</td>\n",
       "      <td>29.44</td>\n",
       "      <td>667.83</td>\n",
       "      <td>79.29</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>34</th>\n",
       "      <td>天津</td>\n",
       "      <td>天津</td>\n",
       "      <td>蓟州区</td>\n",
       "      <td>市辖区</td>\n",
       "      <td>1593</td>\n",
       "      <td>86.24</td>\n",
       "      <td>43.86</td>\n",
       "      <td>42.38</td>\n",
       "      <td>392.55</td>\n",
       "      <td>91.15</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   省级单位 地级单位  县级单位 区划类型  行政面积（K㎡）  户籍人口（万人）      男性      女性  GDP（亿元）  常住人口（万人）\n",
       "0    北京   北京   西城区  市辖区        51    146.47   72.88   73.59  3602.36    125.90\n",
       "1    北京   北京   东城区  市辖区        42     97.41   47.91   49.50  2061.80     87.80\n",
       "2    北京   北京   丰台区  市辖区       306    115.33   58.39   56.95  1297.03    225.50\n",
       "3    北京   北京   西城区  市辖区        51    146.47   72.88   73.59  3602.36    125.90\n",
       "4    北京   北京   朝阳区  市辖区       455    210.91  105.43  105.48  5171.03    385.60\n",
       "5    北京   北京   房山区  市辖区      1990     81.28   40.76   40.52   606.61    109.60\n",
       "6    北京   北京   丰台区  市辖区       306    115.33   58.39   56.95  1297.03    225.50\n",
       "7    北京   北京  石景山区  市辖区        84     38.69   19.87   18.82   482.14     63.40\n",
       "8    北京   北京   海淀区  市辖区       431    240.20  120.08  120.12  5395.16    359.30\n",
       "9    北京   北京   房山区  市辖区      1990     81.28   40.76   40.52   606.61    109.60\n",
       "10   北京   北京   通州区  市辖区       906     74.68   37.08   37.60   674.81    142.80\n",
       "11   北京   北京   顺义区  市辖区      1020     62.74   31.12   31.61  1591.60    107.50\n",
       "12   北京   北京   昌平区  市辖区      1344     61.14   30.72   30.41   753.39    201.00\n",
       "13   北京   北京   大兴区  市辖区      1036     68.38   34.02   34.36  1796.95    169.40\n",
       "14   北京   北京  门头沟区  市辖区      1451     25.12   12.80   12.32   157.86     31.10\n",
       "15   北京   北京   怀柔区  市辖区      2123     28.29   14.13   14.16   259.41     39.30\n",
       "16   北京   北京   平谷区  市辖区       950     40.20   20.22   19.98   218.31     43.70\n",
       "17   北京   北京   密云区  市辖区      2229     43.59   21.77   21.82   251.13     48.30\n",
       "18   北京   北京   延庆区  市辖区      1994     28.42   14.32   14.11   122.66     32.70\n",
       "19   天津   天津   和平区  市辖区        10     42.32   20.37   21.95   802.62     35.19\n",
       "20   天津   天津   河东区  市辖区        39     75.79   38.06   37.73   290.98     97.61\n",
       "21   天津   天津   河西区  市辖区        37     83.20   40.83   42.37   819.85     99.25\n",
       "22   天津   天津   南开区  市辖区        39     87.28   43.30   43.98   652.09    114.55\n",
       "23   天津   天津   河北区  市辖区        27     63.42   31.86   31.56   415.67     89.24\n",
       "24   天津   天津   红桥区  市辖区        21     51.66   25.93   25.73   208.16     56.69\n",
       "25   天津   天津   东丽区  市辖区       460     37.70   18.83   18.87   927.08     76.04\n",
       "26   天津   天津   西青区  市辖区       545     14.85   19.85   20.38  1040.27     85.37\n",
       "27   天津   天津   津南区  市辖区       401     44.83   22.35   22.48   810.16     89.41\n",
       "28   天津   天津   北辰区  市辖区       478     40.39   20.09   20.30  1058.14   6666.00\n",
       "29   天津   天津   武清区  市辖区      1570     92.27   45.86   46.41  1151.65    119.96\n",
       "30   天津   天津   宝坻区  市辖区      1523     71.10   35.72   35.39   684.07     92.98\n",
       "31   天津   天津  滨海新区  市辖区      2270    128.18   66.04   62.14  6654.00    299.42\n",
       "32   天津   天津   宁河区  市辖区      1414     40.00   20.21   19.79   525.37     49.57\n",
       "33   天津   天津   静海区  市辖区      1476     59.79   30.35   29.44   667.83     79.29\n",
       "34   天津   天津   蓟州区  市辖区      1593     86.24   43.86   42.38   392.55     91.15"
      ]
     },
     "execution_count": 97,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pd.concat([bj_37,tj_37],join='outer',axis=0,ignore_index='Ture')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "file_path_bj=open(\"北京地区信息.csv\")\n",
    "file_data_bjinfo=pd.read_csv(file_path_bj)\n",
    "file_data_bjinfo"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 通过列名进行分组"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 115,
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 118,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>key</th>\n",
       "      <th>Data</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>c</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>b</td>\n",
       "      <td>4</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>c</td>\n",
       "      <td>6</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>a</td>\n",
       "      <td>8</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>b</td>\n",
       "      <td>10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>b</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>a</td>\n",
       "      <td>14</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>c</td>\n",
       "      <td>16</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>a</td>\n",
       "      <td>19</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "  key  Data\n",
       "0   c     2\n",
       "1   b     4\n",
       "2   c     6\n",
       "3   a     8\n",
       "4   b    10\n",
       "5   b     1\n",
       "6   a    14\n",
       "7   c    16\n",
       "8   a    19"
      ]
     },
     "execution_count": 118,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_37 = pd.DataFrame({\n",
    "    'key':['c','b','c','a','b','b','a','c','a'],\n",
    "    'Data':[2,4,6,8,10,1,14,16,19]\n",
    "               })\n",
    "df_37"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "###  按key列进行分组"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 119,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<pandas.core.groupby.generic.DataFrameGroupBy object at 0x000000000EFD03C8>"
      ]
     },
     "execution_count": 119,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_37.groupby(by='key')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 120,
   "metadata": {},
   "outputs": [],
   "source": [
    "group_obj=df_37.groupby('key')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 121,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "('a',   key  Data\n",
      "3   a     8\n",
      "6   a    14\n",
      "8   a    19)\n",
      "('b',   key  Data\n",
      "1   b     4\n",
      "4   b    10\n",
      "5   b     1)\n",
      "('c',   key  Data\n",
      "0   c     2\n",
      "2   c     6\n",
      "7   c    16)\n"
     ]
    }
   ],
   "source": [
    "for i in group_obj:\n",
    "    print(i)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##  通过series对象进行分组"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 123,
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd\n",
    "import numpy as py"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 124,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>key1</th>\n",
       "      <th>key2</th>\n",
       "      <th>data1</th>\n",
       "      <th>data2</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>A</td>\n",
       "      <td>one</td>\n",
       "      <td>2</td>\n",
       "      <td>3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>A</td>\n",
       "      <td>two</td>\n",
       "      <td>3</td>\n",
       "      <td>5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>B</td>\n",
       "      <td>one</td>\n",
       "      <td>4</td>\n",
       "      <td>6</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>B</td>\n",
       "      <td>two</td>\n",
       "      <td>6</td>\n",
       "      <td>3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>A</td>\n",
       "      <td>one</td>\n",
       "      <td>8</td>\n",
       "      <td>7</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "  key1 key2 data1 data2\n",
       "0    A  one     2     3\n",
       "1    A  two     3     5\n",
       "2    B  one     4     6\n",
       "3    B  two     6     3\n",
       "4    A  one     8     7"
      ]
     },
     "execution_count": 124,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_37=pd.DataFrame({\n",
    "    'key1':['A','A','B','B','A'],\n",
    "    'key2':['one','two','one','two','one'],\n",
    "    'data1':['2','3','4','6','8'],\n",
    "    'data2':['3','5','6','3','7']\n",
    "})\n",
    "df_37"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 125,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0    a\n",
       "1    b\n",
       "2    c\n",
       "3    a\n",
       "4    b\n",
       "dtype: object"
      ]
     },
     "execution_count": 125,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "se=pd.Series(['a','b','c','a','b'])\n",
    "se"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "###  定义series对象进行分组"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 126,
   "metadata": {},
   "outputs": [],
   "source": [
    "group_obj=df_37.groupby(by=se)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "###  合并   se里的‘1’和‘3’是dataframe里的one two"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 127,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "('a',   key1 key2 data1 data2\n",
      "0    A  one     2     3\n",
      "3    B  two     6     3)\n",
      "('b',   key1 key2 data1 data2\n",
      "1    A  two     3     5\n",
      "4    A  one     8     7)\n",
      "('c',   key1 key2 data1 data2\n",
      "2    B  one     4     6)\n"
     ]
    }
   ],
   "source": [
    "for i in group_obj:\n",
    "    print(i)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "###  数据不想等时，只显示先关的值，"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 128,
   "metadata": {},
   "outputs": [],
   "source": [
    "se=pd.Series(['a','b'])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 131,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "('a',   key1 key2 data1 data2\n",
      "0    A  one     2     3)\n",
      "('b',   key1 key2 data1 data2\n",
      "1    A  two     3     5)\n"
     ]
    }
   ],
   "source": [
    "group_obj=df_37.groupby(by=se)\n",
    "for i in group_obj:\n",
    "    print(i)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 通过字典进行分组"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "####  直接用Dataframe不用加pd，没导入需要加pd"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 132,
   "metadata": {},
   "outputs": [],
   "source": [
    "from pandas import DataFrame,Series"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 146,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>a</th>\n",
       "      <th>b</th>\n",
       "      <th>c</th>\n",
       "      <th>d</th>\n",
       "      <th>e</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1</td>\n",
       "      <td>6</td>\n",
       "      <td>2</td>\n",
       "      <td>11</td>\n",
       "      <td>32</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2</td>\n",
       "      <td>7</td>\n",
       "      <td>6</td>\n",
       "      <td>5</td>\n",
       "      <td>25</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>3</td>\n",
       "      <td>8</td>\n",
       "      <td>4</td>\n",
       "      <td>46</td>\n",
       "      <td>64</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>4</td>\n",
       "      <td>9</td>\n",
       "      <td>2</td>\n",
       "      <td>32</td>\n",
       "      <td>11</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>5</td>\n",
       "      <td>10</td>\n",
       "      <td>9</td>\n",
       "      <td>12</td>\n",
       "      <td>88</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   a   b  c   d   e\n",
       "0  1   6  2  11  32\n",
       "1  2   7  6   5  25\n",
       "2  3   8  4  46  64\n",
       "3  4   9  2  32  11\n",
       "4  5  10  9  12  88"
      ]
     },
     "execution_count": 146,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "num_df_37=DataFrame({\n",
    "    'a':[1,2,3,4,5],\n",
    "    'b':[6,7,8,9,10],\n",
    "    'c':[2,6,4,2,9],\n",
    "    'd':[11,5,46,32,12],\n",
    "    'e':[32,25,64,11,88]\n",
    "})\n",
    "num_df_37"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "###  定义分组规则"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 147,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'a': '第一组', 'b': '第二组', 'c': '第一组', 'd': '第三组', 'e': '第二组'}"
      ]
     },
     "execution_count": 147,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "mapping={\n",
    "    'a':'第一组',\n",
    "    'b':'第二组',\n",
    "    'c':'第一组',\n",
    "    'd':'第三组',\n",
    "    'e':'第二组',\n",
    "}\n",
    "mapping"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 149,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "('第一组',    a  c\n",
      "0  1  2\n",
      "1  2  6\n",
      "2  3  4\n",
      "3  4  2\n",
      "4  5  9)\n",
      "('第三组',     d\n",
      "0  11\n",
      "1   5\n",
      "2  46\n",
      "3  32\n",
      "4  12)\n",
      "('第二组',     b   e\n",
      "0   6  32\n",
      "1   7  25\n",
      "2   8  64\n",
      "3   9  11\n",
      "4  10  88)\n"
     ]
    }
   ],
   "source": [
    "for i in (num_df_37.groupby(mapping,axis=1)):\n",
    "    print(i)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
